package com.etc.controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

	@GetMapping("hello.action")
	public String hello() {
		return "<h1>helloworld</h1>"; // 响应的输出流
	}
//	hello.do?uname=tom&psd=123456
	@RequestMapping("hello.do")
	public List<String> hello1(String uname, String psd, HttpServletRequest req) {
		
		System.out.println("------------------------" + req.getRemoteHost());
		System.out.println(uname + "@" + psd);
		List<String> slist = new ArrayList<>();
		slist.add("tom");
		slist.add("jerry");
		slist.add("mark");
		slist.add("tory");
		slist.add("andi");
		return slist;
	}
}
